package com.qf.shopping.dao;

import com.qf.shopping.entity.ShoppingCart;

import java.util.List;

public interface ICartDao extends BaseDao<ShoppingCart>{
    /**
     * 查询购物车某个用户的商品列表
     * @param uid
     * @return
     */
    List<ShoppingCart> selectProductByUid(Integer uid);

    /**
     * 删除购物车的单个指定商品
     * @param pid
     * @param uid
     * @return
     */
    Integer deleteByPidAndUid(Integer pid, Integer uid);

    ShoppingCart selectProductByPidAndUid(Integer pid, Integer uid);

    Integer updateNumsByPidAndUid(ShoppingCart cart);

    ShoppingCart checkProductByUidAndPid(Integer uid, Integer pid);

    Integer addProductNumsByUidAndPid(ShoppingCart cart);

    List<ShoppingCart> getCartProductNumsByUid(Integer uid);
}
